home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 August / macformat-027.iso / mac / Shareware City / Developers / Oberon⁄F / System / Docu / Domains (.txt) < prev    next >
Encoding:
Oberon Document  |  1994-06-07  |  6.3 KB  |  118 lines  |  [oODC/obnF]

  1. Documents.StdDocumentDesc
  2. Documents.DocumentDesc
  3. Containers.ViewDesc
  4. Views.ViewDesc
  5. Stores.StoreDesc
  6. Documents.ModelDesc
  7. Containers.ModelDesc
  8. Models.ModelDesc
  9. Stores.ElemDesc
  10. TextViews.StdViewDesc
  11. TextViews.ViewDesc
  12. TextModels.StdModelDesc
  13. TextModels.ModelDesc
  14. TextModels.AttributesDesc
  15. Geneva
  16. TextRulers.StdRulerDesc
  17. TextRulers.RulerDesc
  18. TextRulers.StdStyleDesc
  19. TextRulers.StyleDesc
  20. TextRulers.AttributesDesc
  21. Geneva
  22. Geneva
  23. Geneva
  24. HostPictures.StdViewDesc
  25. Geneva
  26. Dialog
  27. Views
  28. Files
  29. Ports
  30. Domains
  31. Fonts
  32. Stores
  33. Models
  34. Controllers
  35. Geneva
  36. 5.1 Domains
  37. DEFINITION Domains;
  38.     CONST exclusive = FALSE; shared = TRUE;
  39.     TYPE
  40.         Message = RECORD END;
  41.         Domain = POINTER TO DomainDesc;
  42.         DomainDesc = RECORD 
  43.             init-, shared-: BOOLEAN;
  44.             PROCEDURE (d: Domain) Handle (VAR msg: Message);
  45.             PROCEDURE (d: Domain) Init (shared: BOOLEAN)
  46.         END;
  47.         OpName = ARRAY 32 OF CHAR;
  48.         Operation = POINTER TO OperationDesc;
  49.         OperationDesc = RECORD 
  50.             inUse-: BOOLEAN;
  51.             name-: OpName;
  52.             PROCEDURE (op: Operation) Do
  53.         END;
  54.     PROCEDURE InitName (op: Operation; name: OpName);
  55.     PROCEDURE MarkAsUsed (op: Operation);
  56. END Domains.
  57. A domain delineates the boundaries between a group of objects and their environment. The objects contained in a document are an example of such a group: the document and its components belong to one domain. When an object of a domain has been modified, the other objects of the same domain may be notified by broadcasting a message to them. Normally, such a broadcast is limited to the same domain. In exceptional cases, messages may be broadcast to several domains, in which case the message source is called a "shared" domain.
  58. Apart from reducing message traffic, domains may have other purposes as well: if the objects in a domain are persistent (-> 5.4 "Stores"), the domain defines which objects are stored in a particular file and which are not.
  59. For documents, a domain is also the scope for undo/redo operations: every document domain manages its own undo/redo stacks for operations.
  60. CONST exclusive, shared
  61. Constants which can be passed to the shared parameter of procedure Domain.Init. Most domains are exclusive.
  62. TYPE Message
  63. Interface
  64. This is the base type of messages to be broadcast in one (or sometimes in several) domains.
  65. Messages are used internally.
  66. Messages are extended internally.
  67. TYPE Domain
  68. Interface
  69. Domains define boundaries around objects, they define which objects are "inside" and which are "outside" from their point of view.
  70. Domains are used in Stores (-> 5.4) to define groups of persistent objects. Each document belongs to at most one domain, notification messages are broadcast in one or several domains, and undo/redo is performed on a per-domain basis.
  71. init-: BOOLEAN
  72. Flag which tells whether the domain has been initialized already.
  73. shared-: BOOLEAN
  74. Flag which tells whether the domain is shared or exclusive.
  75. PROCEDURE (d: Domain) Handle (VAR msg: Message)
  76. Empty
  77. Message handler for a domain.
  78. Handle is called internally.
  79. Handle is extended internally.
  80. PROCEDURE (d: Domain) Init (shared: BOOLEAN)
  81. This procedure sets a domain to either shared or exclusive state.
  82. Init is called internally.
  83. Init is not extended.
  84. ~d.init    20
  85. d.init
  86. d.shared = shared
  87. TYPE OpName
  88. String type for the name of an operation.
  89. TYPE Operation
  90. Operations are objects which perform modifications on other objects. All objects modified by the operation must belong to the same domain. The operation's Do procedure performs the desired modification, and must be involutory, i.e. when called twice, its effect must have been neutralized again.
  91. inUse-: BOOLEAN
  92. Tells whether the operation is alreay in use by a domain.
  93. name-: OpName
  94. The operation's name.
  95. PROCEDURE (op: Operation) Do
  96. Interface
  97. This procedure performs a modification on other objects. It must be involutory, i.e. it must have the identical effect if called an odd number of times, and no effect if called an even number of times.
  98. Do is called internally.
  99. Do must be extended by every concrete operation; many model (-> 5.6) and view (-> 5.7) modifications are implemented as operations.
  100. PROCEDURE InitName (op: Operation; name: OpName)
  101. Initializes the operation's name.
  102. InitName is called internally.
  103. op # NIL    20
  104. op.name = ""    21
  105. op.name = name
  106. PROCEDURE MarkAsUsed (op: Operation)
  107. Marks the operation as "in use".
  108. MarkAsUsed is called internally.
  109. op # NIL    20
  110. ~op.inUse    21
  111. op.inUse
  112. TextControllers.StdCtrlDesc
  113. TextControllers.ControllerDesc
  114. Containers.ControllerDesc
  115. Controllers.ControllerDesc
  116. Geneva
  117. Documents.ControllerDesc
  118.